package com.crm.controller.saling;

import com.crm.service.saling.AdvanceSearchService;
import com.crm.vo.ContractVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;

/**
 * Created by dr5hx on 2018/8/31
 */
@Controller
public class AdvanceSearchController {
    @Autowired
    private AdvanceSearchService advanceSearchService;

    @GetMapping("toContractAdvancedSearch")
    public String toContractAdvancedSearch() {
        return "saling/contractAdvancedSearch";
    }


    @PostMapping("contractAdvanceSearch")
    @ResponseBody
    public List<ContractVO> contractAdvanceSearch(String contractTopic, Date orderStartTime, Date orderOverTime, String cName, String eName, String planName) {
        System.out.println(advanceSearchService.contractAdvanceSearch(contractTopic, orderStartTime, orderOverTime, cName, eName, planName));
        return advanceSearchService.contractAdvanceSearch(contractTopic, orderStartTime, orderOverTime, cName, eName, planName);
    }

}
